'
'
' #########################
' ##### RadioButton #####
' #########################
'
FUNCTION RadioButton ()
$XuiRadioButton = 7
'
GetDisplayGrid ( @label )
'
' create window with XuiRadioButton grid
'
XuiCreateWindow (@grid, @"XuiRadioButton", 100, 256, 256, 128, 0, "")
XuiSendStringMessage ( grid, @"SetCallback", grid,
&XuiQueueCallbacks(),-1,-1, $XuiRadioButton, -1)
XuiSendStringMessage ( grid, @"SetGridName", 0, 0, 0, 0, 0,
@"RadioButton")
XuiSendStringMessage ( grid, @"SetTextString", 0, 0, 0, 0, 0,
@"XuiRadioButton")
XuiSendStringMessage ( grid, @"DisplayWindow", 0, 0, 0, 0, 0, 0)
'
' convenience function message loop
'
DO
XgrProcessMessages (1)
DO WHILE XuiGetNextCallback (@grid, @message$, @v0, @v1, @v2, @v3, @kid, @r1$)
GOSUB Callback
LOOP
LOOP
RETURN
'
' callback
'
SUB Callback
win = kid >> 16
kid = kid AND 0xFF
SELECT CASE message$
CASE "CloseWindow" : QUIT (0)
CASE "Selection" : GOSUB Selection
CASE ELSE : DisplayCallback (grid, @message$, v0, v1,
v2, v3, kid, @r1$)
END SELECT
END SUB
'
' Selection message
'
SUB Selection
IF v0 THEN selected$ = "selected" ELSE
selected$ = "not selected"
text$ = "XuiRadioButton\n\n "
text$ = text$ + selected$
XuiSendStringMessage (label, @"SetTextString", 0, 0, 0, 0, 0, @text$) ' set
message text
XuiSendStringMessage (label, @"Redraw", 0, 0, 0, 0, 0, 0) ' redraw label
END SUB
END FUNCTION